import 'package:flutter/material.dart';
import 'package:flutter_verification_code/flutter_verification_code.dart';

class VerificationCodePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('输入验证码'),
        ),
        body: Container(
            alignment: Alignment.center,
            child: Container(
              width: 300,
              height: 100,
              // color: Colors.blue,
              alignment: Alignment.center,
              child: VerificationCode(
                  textStyle: TextStyle(fontSize: 20.0, color: Colors.red[900]),
                  keyboardType: TextInputType.number,
                  isSecure: true,
                  underlineColor: Colors.amber,
                  // If this is null it will use primaryColor: Colors.red from Theme
                  length: 4,
                  cursorColor: Colors.blue,
                  // If this is null it will default to the ambient
                  // clearAll is NOT required, you can delete it
                  // takes any widget, so you can implement your design
                  clearAll: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Text(
                      '清空',
                      style: TextStyle(
                          fontSize: 14.0,
                          decoration: TextDecoration.underline,
                          color: Colors.blue[700]),
                    ),
                  ),
                  onCompleted: (String value) {},
                  onEditing: (bool value) {}),
            )));
  }
}
